package com.codermn.test;

import java.util.ArrayList;
import java.util.Random;

/**
 * @author jxau_scf
 * @date 2021/5/28 - 20:34
 */
public class RandomNum {
    public static void main(String[] args) {
        ArrayList<Integer> randomNums = new ArrayList<>();
        ArrayList<Integer> resultList = new ArrayList<>();
        Random random = new Random(150);
        for (int i = 0;i < 20;i++){
            randomNums.add(random.nextInt(100)+1);
        }

        for (int randomNum : randomNums){
            if (randomNum % 2 == 0){
                resultList.add(randomNum);
            }
        }

        for (int result : resultList){
            System.out.println(result);
        }

    }
}
